#include <STC15F2K60S2.H>
#include "Seg.h"
#include "Tim.h"
include "ds1302.h"
#include "stdio.h"
unsigned long ulms;
unsigned char pucSeg_Buf[9],pucSeg_Code[8],ucSeg_Pos;
unsigned char pucRtc[3] = {23, 59, 50}; 
void Seg_Proc();
void main(){
//	Init_Ds1302();
	Cls_Peripheral() ;
	Timer1Init();
	Set_RTC(pucRtc);
	while(1){
		//Seg_Tran(*pucSeg_Buf, *pucSeg_Code);
		Seg_Proc();
	}
}
void Time_1(void) interrupt 3 //定时器1中断函数
{ 
	 ulms++; 
	 if(!(ulms % 10))  { 
		 
	 }
	 Seg_Disp(pucSeg_Code, ucSeg_Pos) ;
	 if(++ucSeg_Pos>=8) ucSeg_Pos=0;
} 
void Seg_Proc(){
	if( ulms) return;
	 ulms=1;
	ad_RTC(pucRtc);
	sprintf(pucSeg_Buf, "2 %02d%02d%02d", (unsigned int)pucRtc[0],(unsigned int)pucRtc[1], (unsigned int)pucRtc[2]);
	Seg_Tran(pucSeg_Buf, pucSeg_Code);
}